<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      .container {
        width: 800px;
        height: 400px;
        background-color: cadetblue;
      }
    </style>
  </head>
  <body>
    <div class="container"></div>
    <script src="https://cdn.jsdelivr.net/npm/echarts@5.4.0/dist/echarts.min.js"></script>
    <script>
      const myEcharts = echarts.init(document.querySelector(".container"));
      const option = {
        // title: {
        //   text: "柱形图",
        //   left: "center",
        // },
        xAxis: {
          data: ["星期一", "星期二", "星期三", "星期四", "星期五"],
        },
        yAxis: {
          axisLine: {
            show: true,
          },
          axisTick: {
            show: true,
          },
        },
        tooltip: {},
        series: [
          {
            name: "柱形图",
            type: "bar",
            data: [80, 58, 99, 160, 60],
            color:["yellowgreen"]
          },
          {
            name: "折线图",
            type: "line",
            data: [80, 58, 99, 160, 60],
          },
          {
            name: "饼图",
            type: "pie",
            data: [
              {name: "xx", value: 11, },
              { name: "yy", value: 22 },
              { name: "zz", value: 33 },
            ],
            radius:[0,30],
            center:[650,40]
          },
        ],
        legend:{data:["柱形图","折线图"]},
        dataZoom:{
          type:"slider",
          // startValue:"星期二",
          // endValue:"星期四"
        },
        toolbox:{
          feature:{
            saveAsImage:{},
            dataView:{}
          }
        },
        //定位,控制两边的留白
        grid:{
          left:10,
          right:10,
          containLabel: true,//包含文字在内
        }
      
      };
      myEcharts.setOption(option);
    </script>
  </body>
</html>
